import request from '@/api/request/axios'

// 查询会话业务轨迹
export const querySessionLabelInfo = (tenantId, cusNum) => request({
  url: window.CONFIG.freelinkconfigApi + '/v1/platform/data/label/querySessionLabelInfo/' + tenantId + '/' + cusNum,
  method: 'get'
})

function random(min, max) {
  return Math.floor(Math.random() * (max - min)) + min;
}

export function recommend() {
  //半径
  let radius = $(".picture").width() / 2 + 50;
  //每一个BOX对应的角度;
  let avd = 360 / $(".labelItem").length;
  //每一个BOX对应的弧度;
  let ahd = avd * Math.PI / 180;
  let colorArr = ['#0D88F0', '#2FB384', '#FF3939', '#F5AA3E', '#3FC0F5']
  $(".labelItem").each(function (index, ele) {
    let randomNum = random(0, 4);
    let color = colorArr[randomNum]
    $(this).css({
      "background": color,
      'color': '#fff',
      "left": Math.sin((ahd * index)) * radius - 15,
      "top": Math.cos((ahd * index)) * radius + 30
    });
  });
}
